
#  V  appendix -  figure A6 ---------------
plot_box_dynamic<- function(data = build_dyn_new() ) {

pdf(file = "dyn_bplot_by_month.pdf", width = 10, height = 7.5)
print(
  data %>% ggplot(., 
       aes(y = prob_for_report, x =month_from_index ,group=month_from_index)) +
  geom_boxplot(show.legend = TRUE,outlier.shape = NA)+
  scale_x_continuous(breaks = seq(0,11))+
  scale_y_continuous(breaks = seq(0.1,1,0.1))+
  labs(y = "Current Prognosis (One-Year Mortality Risk)", x="Month After Diagnosis") +
  theme(text = element_text(size = 16))
)
dev.off()

}
